From: Jasper St. Pierre Date: Fri, 15 Nov 2013 15:34:04 +0000 (-0500) Subject: messageTray: Prevent reentrancy issues in _updateState X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~3046 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=87f0e7974993e981835907ac1fb20cb66f329e7d;p=gnome-shell.git messageTray: Prevent reentrancy issues in _updateState The methods we call in _updateState may not be reentrant, so make sure that we never get into a situation where _updateState, through some crazy chain of events, calls itself. https://bugzilla.gnome.org/show_bug.cgi?id=711694 --- diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 2c4f823aa..fa24c139f 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -2356,6 +2356,13 @@ const MessageTray = new Lang.Class({ // _updateState() figures out what (if anything) needs to be done // at the present time. _updateState: function() { + // If our state changes caused _updateState to be called, + // just exit now to prevent reentrancy issues. + if (this._updatingState) + return; + + this._updatingState = true; + // Filter out acknowledged notifications. this._notificationQueue = this._notificationQueue.filter(function(n) { return !n.acknowledged; @@ -2436,6 +2443,8 @@ const MessageTray = new Lang.Class({ this._showDesktopClone(); else if (desktopCloneIsVisible && !desktopCloneShouldBeVisible) this._hideDesktopClone(); + + this._updatingState = false; }, _tween: function(actor, statevar, value, params) {